// unoacking a four-character code to identify a video codec

#include <iostream>
#include <opencv2/highgui.hpp>

int main(int argc, char** argv) {
    if (argc < 2) {
        std::cout << "please input video path!" << std::endl;
        return -1;
    }
    cv::VideoCapture cap(argv[1]);
    if (!cap.isOpened()) {
        std::cout << "don't open video file!" << std::endl;
        return -1;
    }

    unsigned f = (unsigned)cap.get(cv::CAP_PROP_FOCUS);
    char fourcc[] = {
        (char) f,
        (char) (f >> 8),
        (char) (f >> 16),
        (char) (f >> 24),
        '\0'
    };

    std::cout << fourcc << std::endl;
    printf("%s", fourcc);

    return 0;
}

